﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileDisplayer.aspx.cs" Inherits="AspNetObjectSourceFileSystem.FileDisplayer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ListView runat="server" ID="ListViewFiles" 
            DataSourceID="ObjectDataSourceFiles" >
            <AlternatingItemTemplate>
                <li style="background-color: #FFF8DC;">
                    <asp:Label ID="LengthLabel" runat="server" Text='<%# Container.DataItem %>' />
                    <br />
                </li>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <li style="background-color: #008A8C;color: #FFFFFF;">Length:
                    <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </li>
            </EditItemTemplate>
            <EmptyDataTemplate>
                No data was returned.
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <li style="">Length:
                    <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </li>
            </InsertItemTemplate>
            <ItemSeparatorTemplate>
<br />
            </ItemSeparatorTemplate>
            <ItemTemplate>
                <li style="background-color: #DCDCDC;color: #000000;">
                    <asp:Label ID="LengthLabel" runat="server" Text='<%# Container.DataItem %>' />
                    <br />
                </li>
            </ItemTemplate>

            <LayoutTemplate>
                <ul ID="itemPlaceholderContainer" runat="server" 
                    style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <li runat="server" id="itemPlaceholder" />
                </ul>
                <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                    <asp:DataPager ID="DataPager1" runat="server">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <li style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">Length:
                    <asp:Label ID="LengthLabel" runat="server" Text='<%# Eval("Length") %>' />
                    <br />
                </li>
            </SelectedItemTemplate>
        </asp:ListView>

        <asp:ObjectDataSource ID="ObjectDataSourceFiles" runat="server" 
            SelectMethod="GetAllFiles" 
            TypeName="AspNetObjectSourceFileSystem.FilesGetter">
            <SelectParameters>
                <asp:Parameter DefaultValue="c:/" Name="folder" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

        <asp:ListView runat="server" ID="ListViewDirectories" 
            DataSourceID="ObjectDataSourceDirectories" >
            <AlternatingItemTemplate>
                <span style="background-color: #FFF8DC;">
                <asp:Label ID="LengthLabel" runat="server" Text='<%# Container.DataItem %>' />
                <br />
<br /></span>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <span style="background-color: #008A8C;color: #FFFFFF;">Length:
                <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                <br /><br /></span>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <span>No data was returned.</span>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <span style="">Length:
                <asp:TextBox ID="LengthTextBox" runat="server" Text='<%# Bind("Length") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                <br /><br /></span>
            </InsertItemTemplate>
            <ItemTemplate>
                <span style="background-color: #DCDCDC;color: #000000;">
                <asp:Label ID="LengthLabel" runat="server" Text='<%# Container.DataItem %>' />
                <br />
<br /></span>
            </ItemTemplate>
            <LayoutTemplate>
                <div ID="itemPlaceholderContainer" runat="server" 
                    style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <span runat="server" id="itemPlaceholder" />
                </div>
                <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                    <asp:DataPager ID="DataPager1" runat="server">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                ShowLastPageButton="True" />
                        </Fields>
                    </asp:DataPager>
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <span style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">
                Length:
                <asp:Label ID="LengthLabel" runat="server" Text='<%# Eval("Length") %>' />
                <br />
<br /></span>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:ObjectDataSource ID="ObjectDataSourceDirectories" runat="server" 
            SelectMethod="GetAllDirectories" 
            TypeName="AspNetObjectSourceFileSystem.FilesGetter">
            <SelectParameters>
                <asp:Parameter DefaultValue="c:/" Name="folder" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

    </div>
    </form>
</body>
</html>
